#region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Text;

namespace Osh.Configuration
{
	public interface IKeyElement : IConfigurationElement
	{
		string Name { get; set; }
		string Command { get; set; }
	}

	[ClassInterface(ClassInterfaceType.None)]
	public class KeyElement : ConfigurationElement, IKeyElement
	{
		public KeyElement()
		{
		}

		public KeyElement(string name)
		{
			this.Name = name;
		}

		public KeyElement(string name, string command)
		{
			this.Name = name;
			this.Command = command;
		}

		[ConfigurationProperty("name", IsRequired=true, IsKey=true)]
		public string Name
		{
			get { return (string)this["name"]; }
			set { this["name"] = value; }
		}
		 
		[ConfigurationProperty("command", IsRequired=false)]
		public string Command
		{
			get { return (string)this["command"]; }
			set { this["command"] = value; }
		}
	}
}
